﻿using log4net;
using Quartz;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebCrawlerLib;

namespace QuartzTH.Jobs
{
    public class BingWallPaperJob : IJob
    {
        private static readonly ILog logger = LogManager.GetLogger(typeof(BingWallPaperJob));

        public void Execute(IJobExecutionContext context)
        {
            try
            {
                var directoryName = ConfigurationManager.AppSettings["BingWallPaperJob_DirectoryName"];
                BingWallPaperService service = new BingWallPaperService(directoryName);
                service.Start();
            }
            catch (Exception ex)
            {
                logger.ErrorFormat("{0}\r\n{1}", ex.Message, ex.StackTrace);
            }
        }
    }
}
